var question_types          = new Array(); // Div ids for the different question type options
var many_choice_number      = 4;           // Counter for adding additional many choice answers
var multiple_choicee_number = 4;           // Counter for adding additional multiple choice answers

question_types[0] = "true_false_options";      // Div id for the true/false options
question_types[1] = "multiple_choice_options"; // Div id for the multiple choice options
question_types[2] = "many_choice_options";     // Div id for the many choice options


// Shows the options for the selected question type
function show_options(actual_type) {

    // Initially hide all the div elements
    document.getElementById(question_types[0]).style.display = 'none';
    document.getElementById(question_types[1]).style.display = 'none';
    document.getElementById(question_types[2]).style.display = 'none';

    // Show the div for the selected question type
    switch (actual_type) {
        case "true_false":
            document.getElementById(question_types[0]).style.display = 'block';
            break;
        case "multiple_choice":
            document.getElementById(question_types[1]).style.display = 'block';
            break;
        case "many_choice":
            document.getElementById(question_types[2]).style.display = 'block';
            break;
        default:
            //code to be executed
    }

}

// Inserts an additional many choice question
function insert_many_choice() {

    document.getElementById('insert_many_choice').innerHTML += "<input type='checkbox' name='many_choices' value='false' />" + ++choice_number + ". <input type='text' name='name' class='text_box_answer' id='choice_3' /><br>";

}

// Inserts an additional multiple choice answer
function insert_multiple_choice() {

    document.getElementById('insert_multiple_choice').innerHTML += "<input type='radio' name='multiple_choices' value='false' />" + ++choice_letter + ". <input type='text' name='name' class='text_box_answer' id='choice_3' /><br>";

}

// Test function to see if JS is working, not intended for actual use
function show_results(current_div) {
    document.getElementById(current_div).style.display = 'none';

    alert("Question submitted!");
}
